Designers of electronic systems frequently use high-level language systems to model designs before committing them to hardware designs. For example, a designer may use MATLAB™, from The MathWorks, Incorporated of Natick, Mass. (“MATLAB”). MATLAB is a high-level algorithmic language that facilitates efficient mathematical modeling of systems. Unlike other languages such as C, MATLAB is dynamically typed, meaning that formal declarations for variables and constants are unnecessary. Additionally, MATLAB is array-based, where variable dimensions are determined at run-time. These aspects of MATLAB, among others, facilitate efficient modeling because the designer is not burdened with storage requirements and data typing.
FIG. 1 illustrates the MATLAB design flow 100. The MATLAB user, such as a designer, creates a mathematical model 110 of a design using floating-point number variables. This MATLAB model 110 may include several files: A MATLAB script file 130 where the model is expressed as an algorithm; a MATLAB function file 125 which includes various functions used by the script file; and a MATLAB coefficient file 120, which may be used as inputs to the algorithm. After the user creates an initial MATLAB model 110 by preparing a script file, and if necessary, function and coefficient files, the user may then execute the script file using the MATLAB environment 135. Upon executing the script file, the results may be displayed 140. The designer can examine the results and then make appropriate changes to the model 110 by modifying one of the files that comprise the model, such as the coefficient file 120 or the script file 130.
Dynamically typed, array-based languages such as MATLAB provide various efficiencies to the designer during the modeling stage allowing the designer to create mathematical models without the burden of defining variable size and shape for each variable used in the model. However, these same features create challenges during design synthesis. Synthesis generates a file that is implemented directly in hardware. Unlike the MATLAB model, this resulting hardware implementation may not contain variables of unknown size and shape.
For example, FIG. 2A illustrates the mapping of a MATLAB script file 208 to a synthesized hardware module 209. The hardware module 209 has an input port 203, and output port 207 and other elements that can be used to perform various functions, such as a gate array 205. The script file 208 maps elements onto the hardware module 209 in order to synthesize the design. For example, the data inputs 202 in the script file 208 are mapped onto physical hardware inputs 203, and data outputs 206 from the script file 208 are mapped onto physical hardware outputs 207. Similarly, various functions and modules in the script file 208, such as fir16tap 204, map to resources 205 in the hardware module 209.
So that the correct number of hardware elements such as registers, data lines, and storage devices is allocated for each variable in the MATLAB model, the size and shape of variables are determined in advance of implementing any synthesized model in hardware. The number of inputs and outputs required by the MATLAB model determines the number of physical inputs and outputs allocated in the hardware implementation. Likewise, variables in the MATLAB script file require particular allocations of size and shape depending upon their use in the MATLAB model, which is determined prior to implementation in hardware.
As discussed above, MATLAB does not require designers to define the size and shape of the variables. In order to obtain a hardware implementation of the MATLAB model, the size and shape of all undeclared variables is determined automatically. In some instances, the designer may override the automatic size and shape determination by specifying a size or shape for a particular variable. Additionally, other parameters related to variables, such as loop indices, initial and final values, may also be either automatically determined or manually specified by the designer. Presenting this information to the designer and allowing the designer to manually specify selected attributes and parameters in a clear and efficient manner is difficult.
The designer requires an interactive system to review and customize variables types, sizes and dimensions. The system should automatically present the design in a manner that represents the algorithm being modeled, allowing the designer to compare and verify the typed- and dimensioned-design, for example a design that can be implemented in hardware, against the MATLAB model to determine whether the variable sizes, types, and dimensions are appropriate. The designer should also be able to modify the variable types, sizes, and dimensions and compare the results.